<%--
  author: fuxueHu
  description: 招聘信息
--%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" import="java.util.*"
         isELIgnored="false" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<rapid:override name="title">招聘信息管理</rapid:override>

<rapid:override name="head_extend">
    <link href="/static/admin_v1/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/static/admin_v1/css/addTable.css" rel="stylesheet"/>
    <%--分页--%>
    <link rel="stylesheet" type="text/css" href="/static/dataTable/jquery.dataTables.min.css">
    <script type="text/javascript" src="/static/dataTable/jquery.dataTables.min.js"></script>
    <script>
        $(function () {
            $('#pagination').bootstrapPaginator({
                bootstrapMajorVersion: 3,
                currentPage: ${requestScope.pageInfo.pageNum },
                totalPages: ${requestScope.pageInfo.pages },
                pageUrl: function (type, pageNum, current) {
                    return '/admin/recruit/find?pageNum=' + pageNum;
                },
                itemTexts: function (type, page,current) {
                    switch (type) {
                        case "first":
                            return "首页";
                        case "prev":
                            return "上一页";
                        case "next":
                            return "下一页";
                        case "last":
                            return "末页";
                        case "page":
                            return page;
                    }
                }
            });
        });
    </script>
</rapid:override>

<rapid:override name="content">
    <div class="row" style="height: 100%">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>招聘信息管理</h5>
                    <div class="ibox-tools">
                        <button id="addButton" type="button" class="btn btn-w-m btn-success">发布招聘</button>
                    </div>
                </div>

                <div id="modal" class="modal">
                    <div class="modal-content">
                        <span class="close">&times;</span>
                        <h2 id="h0">招聘信息</h2>
                        <div class="ibox-content">
                            <form class="form-horizontal" id="dataForm">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">标题：</label>
                                    <div class="col-sm-8">
                                        <input type="text" name="title" placeholder="标题" class="form-control">
                                        <span class="help-block m-b-none">请输入招聘标题名</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">关联岗位：</label>
                                    <div class="col-sm-8">
                                        <select id="position" name="position" class="form-control m-b">

                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">招聘人数：</label>
                                    <div class="col-sm-8">
                                        <input type="text" name="needPeople" placeholder="招聘人数" class="form-control">
                                        <span class="help-block m-b-none">请输入招聘人数</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">参考薪资：</label>
                                    <div class="col-sm-8">
                                        <select name="salaryCase" class="form-control m-b">
                                            <option>15k</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">工作性质：</label>
                                    <div class="col-sm-8">
                                        <select name="workTYpe" class="form-control m-b">
                                            <option>实习</option>
                                            <option>全职</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">学历要求：</label>
                                    <div class="col-sm-8">
                                        <label class="checkbox-inline">
                                            <input type="checkbox" value="option1" id="inlineCheckbox1">大专</label>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" value="option2" id="inlineCheckbox2">本科</label>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" value="option3" id="inlineCheckbox3">硕士</label>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">薪资范围：</label>
                                    <div class="col-sm-8">
                                        <input name="salary_range" class="form-control m-b">
                                            <option>java初级工程师</option>
                                        </input>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">截至日期：</label>
                                    <div class="col-sm-8">
                                        <input id="hello" class="laydate-icon form-control layer-date">
                                    </div>
                                </div>


                                <div class="form-group">
                                    <div class="col-sm-offset-3 col-sm-8">
                                        <button class="btn btn-sm btn-info" type="submit">发 布</button>
                                    </div>
                                </div>
                                <button type="button" class="close">取消</button>
                            </form>
                        </div>
                    </div>
                </div>

                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-2 m-b-xs">
                            <select class="input-sm form-control input-s-sm inline">
                                <option value="0">职位类型</option>
                                <option value="1">校招</option>
                                <option value="2">社招</option>
                                <option value="3">实习</option>
                            </select>
                        </div>

                        <div class="col-sm-7 m-b-xs">
                            <div data-toggle="buttons" class="btn-group">
                                <label class="btn btn-sm btn-white">
                                    <input type="radio" id="option1" name="options">大专</label>
                                <label class="btn btn-sm btn-white active">
                                    <input type="radio" id="option2" name="options">本科</label>
                                <label class="btn btn-sm btn-white">
                                    <input type="radio" id="option3" name="options">硕士</label>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" placeholder="请输入关键词" class="input-sm form-control"> <span
                                    class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                            </div>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>

                                <th><input type="checkbox"></th>
                                <th>招聘Id</th>
                                <th>名称</th>
                                <th>岗位</th>
                                <th>所属部门</th>
                                <th>薪资范围</th>
                                <th>招聘人数</th>
                                <th>已投人数</th>
                                <th>发布时间</th>
                                <th>截至时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${requestScope.pageInfo.list}" var="recruitInfo">
                                <tr>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                    <td>${recruitInfo.recruitId}</td>
                                    <td>${recruitInfo.title}</td>
                                    <td>${recruitInfo.position}</td>
                                    <td>${recruitInfo.department}</td>
                                    <td>${recruitInfo.salary}</td>
                                    <td>${recruitInfo.needPeople}</td>
                                    <td>${recruitInfo.applyPeople}</td>
                                    <td>${recruitInfo.publishTime}</td>
                                    <td>${recruitInfo.endTime}</td>
                                    <td><a href="/admin/recruit/find/${recruitInfo.recruitId}"><span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span></a>
                                    </td>
                                </tr>
                            </c:forEach>

                            </tbody>
                        </table>
                    </div>
                    <div class="col-sm-1">
                        <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
                    </div>
                    <div class="col-sm-1">
                        <div class="input-group m-b">
                            <div class="input-group-btn">
                                <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="false">容量<span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="form_basic.html#">3</a>
                                    </li>
                                    <li><a href="form_basic.html#">5</a>
                                    </li>
                                    <li><a href="form_basic.html#">10</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-7">
                        <div class="input-group m-b">
                            <ul id="pagination"></ul>
                        </div>
                    </div>



                </div>
            </div>
        </div>

    </div>
</rapid:override>

<script>
    $.ajax({
        url:'/admin/positionController/findId',
        method:"get",
        dataType: "json",
        success:res=>{
            for(var i in res){
                map=res[i]
                $('#position').append(
                    '<option value="'+map.id+'">'+map.positionName+'</option>'
                )
            }
        }
    })
</script>


<rapid:override name="js_extend">
    <!-- Bootstrap table -->
    <script src="/static/admin_v1/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/static/admin_v1/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/static/admin_v1/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/static/admin_v1/js/bootstrap-paginator.js"></script>

    <%--    日期--%>
    <script src="/static/admin_v1/js/plugins/layer/laydate/laydate.js"></script>

    <!-- Peity -->
    <script src="/static/admin_v1/js/bootstrap-table-demo.js"></script>
    <script src="/static/admin_v1/js/date.js"></script>
    <script src="/static/admin_v1/js/addTable.js"></script>


</rapid:override>

<%@include file="/jsp/common/admin/base.jsp" %>